package mop.exception;

/**
 * Exception class for incorrect names
 * 
 * @author	 MOP Team 7
 */
public class IllegalIdException extends Throwable 
{

	/**
	 * Initializes an IllegalIdException with the passed id
	 * 
	 * @param id
	 *  the id thats incorrect
	 *  
	 * @effect set the id
	 */
	public IllegalIdException(String id)
	{
		this.setid(id);	
	}
	
	/**
	 * Return a error message that can be used by the gui
	 * @return An error message describing the incorrect id
	 */
	public String toString()
	{
		return "Incorrect id given: "+id;
	}
	
	 /**
	  * Set the id
	  * 
	  * @param id
	  *  the id that's causing a racket
	  *  
	  * @post the id is set to the passed one
	  * 
	  */
	 private void setid(String id) 
	 {
		 this.id = id;
	 }
	
	/**
	 * Weird java demand
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * The id thats causing the problem
	 */
	private String id;
	
}
